Calibration of camera systems can be made by having a camera system acquiring an image of a colour chart, and comparing the obtained values for the different patches to known reference values in a specified colour space, for instance standard RGB. A calibration algorithm calculates a transform in order to reduce the errors between the acquired values for the patches and the reference values. This transformation results in corrected colours from the camera for the specified colour space.
Colour charts have traditionally been rectangular having several square or rectangular patches. The colours of the patches are carefully selected so that they cover the gamut of the specified colour space, and in specific cases, colours that are regularly present in the images are also added to the chart to increase precision of the calibration. For instance, the colour chart in FIG. 1 is optimized for medical applications (http://dsclabs.com/dsc-products/law-enforcement-medical/the-medicol-chart/). The chart includes 32 precision colour chips providing an expanded colour gamut said to be specially designed for the medical imaging community. A nine step grayscale is said to provide a neutral, dynamic range reference. DSC CamWhite on the rear is said to provide a spectrophotometrically neutral white reference for quick white balancing.
For instance also, the colour chart TE188 from Image Engineering like in FIG. 1 is optimized for medical applications (http://www.image-engineering.de/products/solutions/starter-kits/637-starter-kit-medical-endoscopy and http://www.image-engineering.de/products/charts/all/516-te188). The chart includes 18 precision colour chips providing an expanded colour gamut said to be specially designed for the medical imaging community. A 6 step grayscale can provide a neutral, dynamic range reference.                TE132—TE132 ISO test pattern No. 2 (1-18 LP/mm—sheet with 12 patterns) chart size D35        TE188—TE188 color rendition chart size D35 (X-Rite ColorChecker)        TE240—TE240 ISO 21550 dynamic range chart size D35 (available with max. density 4.0 or 6.0)        TE250—USAF 1951 target chart size D35        
These types of colour charts may not be suitable for camera systems with an integrated light source that are used to inspect enclosed spaces, such as endoscopes. Endoscopes can for example be used in healthcare applications or to inspect machines or engines, or to inspect building constructions. There are several hurdles to overcome when calibrating an endoscope:    a. Most endoscopes have a built-in automatic gain control system to optimize the image performance under the very different lighting conditions inside the structure to be inspected. Depending on the distance of the camera and its built-in illumination to the environment, the image can become darker or lighter. To compensate this, the camera changes automatically its gain to have always a bright image. Automatic gain control algorithms are based on increasing gain until a certain number of pixels are saturated and clipped. This has an influence on how colours are acquired by the camera system. If the camera saturates at a certain colour, the reproduction of that colour (and possibly others depending of it) will be incorrect. Conventional colour charts do not take into account automatic gain control algorithms of cameras.    b. An effect of a built-in light source is that the image illumination is non-uniform and can resemble a torch, i.e. the centre of the viewing field is very bright and at the edges the image are covered in shadow. The result can be that with conventional colour charts the illumination of the centre patches differs from that of the patches towards the edge. This has a big influence on how the colour patches at different locations are acquired by the camera. Thus, a conventional rectangular colour chart is not suitable for colour calibration of systems with a built-in light source.    c. The calibration process can depend on knowledge of the coordinates of the different patches. Thus, it is important to know the relation between the camera pixels and the coordinates of the colour chart, so the camera needs to be aligned with the colour chart. With a conventional camera system, the housing and field of view of the camera is often rectangular so it is intuitive to align the camera with a rectangular colour chart. The field of view of an endoscope is also rectangular but the image is clipped to a circular shape by the optical system. So in case of the typical round tube and small endoscope housing, or in the case of the glass fibre, the natural approach to alignment by selecting a rectangular shape is lost. Thus, it is difficult to align an endoscope system to a conventional colour chart.    d. Alternatively, the position of a patch can be automatically detected, e.g. by recognizing the rectangular shape of the patch, but also by comparing the acquired values of the patch to the reference values to define the orientation of the colour chart. To be really certain that a patch corresponds with a reference value, the image has to be calibrated. But to calibrate the image, the patches need to be extracted first. Thus, this alternative method is not solving the problem of alignment.    e. An endoscope camera is normally not directly inserted inside the structure to be inspected. A tube or glass fibre with a lens is connected to the camera of the endoscope and this tube or fibre is inserted in the structure to be inspected. This optical path is not perfect. For example, crosstalk inside the tube results in light structures next to the patches that are creating a light shadow border inside the patch. This has an effect on the final calibration because the error between the acquired values and the reference values is artificially increased. Conventional colour charts do not consider this cross talk.    f. Colour charts are available in a large number of varieties but also in numbered versions. Many colour calibration algorithms support the use of different colour charts. The chart is either manually selected or automatically detected based on the acquired values of the patches. For automatic detection, it is assumed that the used chart is the one with the reference values for the patches being the closest to the acquired values. In either case there is a risk that the wrong colour chart is selected, which would lead to incorrect calibration results.
During calibration it is also desirable to have the colour chart and camera uptake shielded from ambient light in order to mimic the environment during endoscope operation.